<?php
namespace Crm\Api;

use PhalApi\Api;
use Crm\Domain\Shop as DomainShop;

/**
 * 商家服务类
 *
 * @author: luodong <751450467@qq.com> 2020-06-24
 */

class Shop extends Api {

	public function getRules() {
        return array(
            'shopList' => array('mall_id' 	=> array('name' => 'mall_id', 'type'=>'int','require'=>true,'desc'=>'默认商城ID')),
            'detail' => array('shop_id' 	=> array('name' => 'shop_id', 'type'=>'int','require'=>true,'desc'=>'商家ID'))
        );
	}

    /**
     * 获取礼品列表
     * @desc 获取商城礼品列表
     * @return obj awardList 商城礼品列表
     * @return int time 当前时间戳
     */
    public function shopList(){
        $domain = new DomainShop();
        $param = \PhalApi\DI()->request->getAll();
        $data= $domain->search($this->mall_id,$param);
        return $data;
    }

    /**
     * 获取商家详情
     * @desc 获取商家详情
     * @return obj Detail 商家详情
     * @return int time 当前时间戳
     */
    public function detail(){
        $domain = new DomainShop();
        $data= $domain->detail($this->shop_id);
        return $data;
    }

}
